package com.teaphy.coroutinecrawler.flow.operators.transform

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.transform

fun main() = runBlocking{
    flowOf(1, 2, 3)
        .transform {
            ele ->
            repeat(ele) {
                emit(ele)
                delay(100)
            }
        }.collect {
            println("receive: $it")
        }

    println("Done")
}